/****************************************************************************
 *   Copyright (C) 2011  Instituto Nokia de Tecnologia (INdT)               *
 *                                                                          *
 *   This file may be used under the terms of the GNU Lesser                *
 *   General Public License version 2.1 as published by the Free Software   *
 *   Foundation and appearing in the file LICENSE.LGPL included in the      *
 *   packaging of this file.  Please review the following information to    *
 *   ensure the GNU Lesser General Public License version 2.1 requirements  *
 *   will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.   *
 *                                                                          *
 *   This program is distributed in the hope that it will be useful,        *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
 *   GNU Lesser General Public License for more details.                    *
 ****************************************************************************/

#ifndef BrowserObject_h
#define BrowserObject_h

#include <QtCore/QObject>
#include <QtCore/QUrl>

class BrowserWindow;

class BrowserObject : public QObject {
    Q_OBJECT
    Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle NOTIFY windowTitleChanged)

public:
    QString windowTitle() const;
    void setWindowTitle(const QString&);

    Q_INVOKABLE QUrl urlFromUserInput(const QString&);
    Q_INVOKABLE bool isUrlValid(const QUrl&);
    Q_INVOKABLE bool isUrlEmpty(const QUrl&);

    Q_INVOKABLE void updateUrlsOpened(const QStringList&);

signals:
    void windowTitleChanged();

private:
    friend class BrowserWindow;
    BrowserObject(BrowserWindow*);
    BrowserWindow* m_window;
};

#endif
